<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{:config('sys_name')}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="__STATIC__/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="__ADMIN__/css/global.css" media="all">
    <link rel="stylesheet" href="__STATIC__/common/css/font.css" media="all">
    <script type="text/javascript" src="__STATIC__/common/js/jquery.2.1.1.min.js"></script>
    <script type="text/javascript" src="__STATIC__/plugins/layui/layui.js"></script>
    
    {block name="head"}{/block}
    <script>
        var ADMIN = '__ADMIN__';
        //var navs = {$menus};
        //var currentURL="{$currentURL}";
    </script>
</head>
<body class="skin-0" style="background-color: #212121;">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header header">
        <div class="layui-main">
            <div class="admin-login-box">
                
                <div class="admin-side-toggle fs1">
                    <span class="icon icon-menu"></span>
                </div>
                <!-- <div class="admin-side-full">
                     
                </div> -->
            </div>

            <ul class="layui-nav admin-header-item" lay-filter="side-top-right">
                <!-- <li class="layui-nav-item" id="_cache">
                    <a href="javascript:;" data-href="{:url('admin/index/clear')}">{:lang('clearCache')}</a>
                </li> -->
               <li class="layui-nav-item ms-notice m-nav-item">
                   <a class="name nav-a" data="{:U('message/unreads')}" href="javascript:;">
                    <!-- <span id="messages-count" class="layui-badge-dot"></span> -->
                    <img src="__STATIC__/admin/images/notice-icon.png" class="layui-nav-img" /> 
                </a>
                   <dl class="layui-nav-child notice-list">
                   
                   </dl>
                    
                </li>
                <li class="layui-nav-item lang m-nav-item">
                    <a class="name nav-a " href="javascript:;" ><img src="__STATIC__/admin/images/lang-{$lang}.png" class="layui-nav-img" /></a>
                    <dl class="layui-nav-child ">
                        <dd><a href="javascript:;" data-lang="zh-tw" data-href="{:U('index/changeLang')}" class="_changeLang"><img src="__STATIC__/admin/images/zh-tw.png" /> {:lang('zh-tw')}</a></dd>
                        <dd><a href="javascript:;" data-lang="en-us" data-href="{:U('index/changeLang')}" class="_changeLang"><img src="__STATIC__/admin/images/en-us.png"  /> {:lang('en-us')}</a></dd>
                    </dl>
                </li>
                <!-- <li class="layui-nav-item">
                    <a class="name" href="javascript:;">主题</a>
                    <dl class="layui-nav-child">
                        <dd data-skin="0"><a href="javascript:;">默认</a></dd>
                        <dd data-skin="1"><a href="javascript:;">纯白</a></dd>
                        <dd data-skin="2"><a href="javascript:;">蓝白</a></dd>
                    </dl>
                </li> -->
                <li class="layui-nav-item m-nav-item">
                    <a href="javascript:;" class="admin-header-user nav-a">
                        <img src="__STATIC__/admin/images/user-icon.png" class="layui-nav-img" />
                        <span></span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="{:url('Auth/editpaw')}"><i class="fa fa-sign-out" aria-hidden="true"></i>{:lang('Change Password')}</a>
                        </dd>
                        <dd>
                            <a href="{:url('Auth/userinfo')}"><i class="fa fa-sign-out" aria-hidden="true"></i>{:lang('User Profile')}</a>
                        </dd>
                        <dd>
                            <a href="{:url('user/login/logout')}"><i class="fa fa-sign-out" aria-hidden="true"></i>{:lang('Logout')}</a>
                        </dd>
                    </dl>
                </li>
            </ul>
            
        </div>
    </div>
    <div class="layui-side layui-bg-black" id="admin-side">
        <div class="layui-side-scroll" id="admin-navbar-side" lay-filter="side">
            <div class="cloud-fast-logo">
                <img src="__STATIC__/admin/images/logo-2.png"/>
            </div>
            <ul class="layui-nav layui-nav-tree beg-navbar">
                <!-- <li class="layui-nav-item ">
                <a  href="{:U('index/index')}"><i class="icon icon-home"></i><cite>Dashboard</cite></a>
                </li> -->
               <!--  <li class="layui-nav-item">
                <a  href="{:U('network/query')}"><i class="icon icon-calculator"></i><cite>{:lang('Calculator')}</cite></a>
                </li> -->
              <?php foreach($menus as $menu):?>
              <li class="layui-nav-item {$menu['spread'] ? 'layui-nav-itemed' : ''}">
                <?php if(isset($menu['children']) && !empty($menu['children'])):?>
                <a class="javascript:;" href="javascript:;">
                <?php else: ?>
                <a  href="{$menu['href']}">
                <?php endif;?>
                    <i class="icon {$menu['icon']}"></i><cite>{:lang($menu['title'])}</cite>
                    <?php if(isset($menu['children']) && !empty($menu['children'])):?><span class="layui-nav-more"></span><?php endif;?></a>
                <?php if(isset($menu['children']) && !empty($menu['children'])):?>
                <dl class="layui-nav-child">
                    <?php foreach($menu['children'] as $item):?>
                      <dd class="{$item['spread'] ? 'layui-nav-itemed' : ''}">
                            <?php if($item['href'] == U('index/clear')):?>
                              <a href="javascript:;" data-href="{$item['href']}" id="_cache" ><cite>{:lang($item['title'])}</cite></a>
                          <?php else:?>
                              <a href="{$item['href']}" ><cite>{:lang($item['title'])}</cite></a>
                           <?php endif;?>
                      </dd>
                  <?php endforeach;?>
                </dl>
                <?php endif;?>
                <span class="nav-rightline"></span>
              </li>
              <?php endforeach;?>
            </ul>
        </div>
    </div>
    <div class="layui-body" style="bottom: 0;" id="admin-body">
        <div style="" class="body-top-nav"> 
                        <span class="layui-breadcrumb" >
                          <a href="{:U('index/index')}">Home</a>
                          <?php foreach($navList as $nav):?>
                          <a href="javascript:;">{:lang($nav)}</a>
                      <?php endforeach;?>
                        </span>
                    </div>
        <div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
           <!--  <ul class="layui-tab-title">
                <li class="layui-this">
                    <i class="icon icon-earth" aria-hidden="true"></i>
                    <cite>控制面板</cite>
                </li>
            </ul> -->
            <div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0; ">
                <div class="layui-tab-item layui-show">     
                    

                    <div class="admin-mains ">
                        {block name="main"}{/block}
                    </div>
                   <br/>
                   <br/>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-footer footer footer-demo" id="admin-footer" style="z-index: 1000;">
        <div class="layui-main">
            <p>Copyright © 2018 深圳华科云动力科技有限公司. All rights reserved. 粤ICP备16116157号-2
            </p>
        </div>
    </div>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>
</div>

<script src="__STATIC__/common/js/angular.min.js"></script>
<script type="text/javascript" src="__ADMIN__/js/common.js"></script>
<script src="__ADMIN__/js/index.js"></script>
<script type="text/javascript">
    $.post("{:U('message/getNotice')}",{},function($rel){
        if($rel.code == 1){
            $("#messages-count").show();
            $.each($rel.data,function(i,item){
                var html = '<dd><a href="#" data-href="'+item.url+'" class="_noticetitle _layer-dialog" data-title="{:lang('Messages')}">'+item.title+'</a><div class="notice-time">'+item.create_time+'</div></dd>';
                $(".ms-notice").find(".layui-nav-child").append(html);
            })
            if($rel.count > $rel.data.length){
                $(".ms-notice").find(".layui-nav-child").append("<dd class='notice-more'><a href='{:url('message/unreads')}'>{:lang('View all messages')} <i class='icon icon-arrow-right2'></i></a></dd>");
            }
            
        }else{
            $(".ms-notice").find(".layui-nav-child").remove();
        }
    })
    $("._changeLang").click(function(){
         var loading = layer.load(1, {shade: [0.1, '#fff']});
         $.post($(this).data('href'),{lang:$(this).data('lang')},function(res){
            layer.close(loading);
            location.reload();
         })
    })
</script>
{block name="footer"}{/block}

</body>
</html>

